browser library

if (WebSocket) {

}

register( regex, hander ) {
}

handler
- onconnect
- onrequest
- onerror
unregister( ) 


klijent:

1. connect to server
2. send message - register
3. receive register response
4. receive request
5. process request
6. send response
7. send unregister
8. receive unregister

on connect
on message
on close
on error

write
close

register("path", handler)

handler.onconnect(path, realPrefix)

handler.onmessage(request, response)

response.statusCode, msg, version, headers, body, send


cross-domain?
testing?
what if something gets disconnected?